<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" th:href="@{/static/element/index.css}"/>
</head>
<body>
<style>
    .el-input-item {
        width: 260px;
    }

</style>
<div id="app">
    <template>
        <el-form :model="formData" ref="formData" :rules="rules" label-width="100px"
                 style="margin-top: 5%;display: flex;flex-direction: row;align-items: center;flex-wrap: wrap;justify-content: space-between;margin-right: 5%">
            <el-form-item label="模块标题" prop="title">
                <el-input class="el-input-item" size="small" v-model="formData.title" placeholder="请输入模块标题"/>
            </el-form-item>
            <el-form-item label="方法名称" prop="method">
                <el-input class="el-input-item" size="small" v-model="formData.method" placeholder="请输入方法名称"/>
            </el-form-item>
            <el-form-item label="请求方式" prop="requestMethod">
                <el-input class="el-input-item" size="small" v-model="formData.requestMethod" placeholder="请输入请求方式"/>
            </el-form-item>
            <el-form-item label="操作人员" prop="operName">
                <el-input class="el-input-item" size="small" v-model="formData.operName" placeholder="请输入操作人员"/>
            </el-form-item>

            <el-form-item label="请求URL" prop="operUrl">
                <el-input class="el-input-item" size="small" v-model="formData.operUrl" placeholder="请输入请求URL"/>
            </el-form-item>
            <el-form-item label="主机地址" prop="operIp">
                <el-input class="el-input-item" size="small" v-model="formData.operIp" placeholder="请输入主机地址"/>
            </el-form-item>
            <el-form-item label="操作地点" prop="operLocation">
                <el-input class="el-input-item" size="small" v-model="formData.operLocation" placeholder="请输入操作地点"/>
            </el-form-item>
            <el-form-item label="请求参数" prop="operParam">
                <el-input class="el-input-item" size="small" v-model="formData.operParam" type="textarea"
                          placeholder="请输入内容"/>
            </el-form-item>
            <el-form-item label="返回参数" prop="jsonResult">
                <el-input class="el-input-item" size="small" v-model="formData.jsonResult" type="textarea"
                          placeholder="请输入内容"/>
            </el-form-item>

            <el-form-item label="操作时间" prop="operTime">
                <el-date-picker clearable size="small" style="width: 260px"
                                v-model="formData.operTime"
                                type="datetime"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                placeholder="选择操作时间">
                </el-date-picker>
            </el-form-item>
        </el-form>

    </template>
</div>
</body>
<script th:src="@{/static/js/axios.min.js}"></script>
<script th:src="@{/static/js/request.js}"></script>
<script th:src="@{/static/js/common.js}"></script>
<script th:src="@{/static/api/sysOperLog.js}"></script>
<script th:src="@{/static/js/vue.min.js}"></script>
<script th:src="@{/static/element/index.js}"></script>
<script th:src="@{/static/js/jquery.min.js}"></script>
<script th:src="@{/static/layer/layer.js}"></script>
<script>
    let id = getQueryString("id");
    new Vue({
        el: '#app',
        data() {
            return {
                formData: {
                    id: '',
                    postName: '',
                    postCode: '',
                    remark: ''
                },
                rules: {}
            }
        },
        created() {
            if (id) {
                detail(id).then((res) => {
                    if (res.code === '200') {
                        this.formData = res.data
                    }
                });
            } else {
                this.formData = {}
            }

        },
        methods: {
            handleSubmit() {
                if (id) {
                    addOrUpdate('/admin/sysOperLog/update', this);
                } else {
                    addOrUpdate('/admin/sysOperLog/add', this);
                }
            }
        }
    });
</script>
</html>
